//47
class Solution {
    ListListInteger ret = new ArrayList();
    ListInteger tmp = new ArrayList();

    public ListListInteger permuteUnique(int[] nums) {
        int len = nums.length;
        boolean[] flag = new boolean[len];
        Arrays.sort(nums);
        fun(flag, 0, nums);
        return ret;
    }

    public void fun(boolean[] flag, int len, int[] nums)  {
        if (len == nums.length) {
            ListInteger list = new ArrayList();
            list.addAll(tmp);
            ret.add(list);
            return;
        }
        for (int i = 0; i  nums.length; i++) {
            if (!flag[i]) {
                flag[i] = true;
                tmp.add(nums[i]);
                fun(flag, len+1, nums);
                int a = nums[i];
                flag[i] = false;
                tmp.remove(tmp.size()-1);
                while (i+1  nums.length && a == nums[i+1]) {
                    i++;
                }
            }
        }
    }
}
给定一个数字，判定一个数字是否是素数
import java.util.Scanner;

public class Main{
    public static void main (String[] arr){
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();

        for (int i = 2; i < n; i++){
            if (n % i == 0){
                System.out.println(n+"不是素数");
                return;
            }
        }
        System.out.println(n+"是素数");
    }
}